import request from '@/utils/request'

// 获取列表
export function getList() {
  return request({
    url: '/helpcenter/menu',
    method: 'get'
  })
}

// 更新
export function update(params) {
  request.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
  debugger
  return request({
    url: '/helpcenter/menu',
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: params
  })
}

// 获取详情
export function get(id) {
  return request({
    url: '/helpcenter/menu/' + id,
    method: 'get'
  })
}

// 检查email
export function del(params) {
  return request({
    url: '/helpcenter/menu',
    method: 'delete',
    params
  })
}

// 获取父级菜单
export function getParent() {
  return request({
    url: '/helpcenter/menu/parent',
    method: 'get'
  })
}

// 获取父级菜单
export function getChildren(params) {
  return request({
    url: '/helpcenter/menu/parent',
    method: 'get',
    params
  })
}
